home *** CD-ROM | disk | FTP | other *** search
/ Java Programmer's Toolkit / Java Programmer's Toolkit.iso / applets / dance / classes / figur.jav < prev    next >
Encoding:
Text File  |  1995-11-07  |  52.5 KB  |  1,496 lines

  1. /*-
  2.  * Copyright (c) 1995 by Georg Hessmann.
  3.  * All Right Reserved.
  4.  *
  5.  * Figur.java    1.0   25 Aug 1995
  6.  *        1.1   13 Sep 1995
  7.  *
  8.  */
  9.  
  10. import java.lang.Math;
  11. import java.io.InputStream;
  12.  
  13. import java.lang.Runnable;
  14. import java.lang.Thread;
  15. import java.net.URL;
  16. import java.awt.Graphics;
  17. import java.awt.Image;
  18. import java.awt.Color;
  19. import java.awt.Font;
  20.  
  21. import Dance;
  22. import Step;
  23. import Sound;
  24.  
  25.  
  26. /**
  27.  * Figur is the main class for storing/displaying the dance figures.
  28.  * It is (should be) an abstract class. Don't create an instance of
  29.  * it. Create only objects of the classes SlowWaltz, Tango, SlowFox
  30.  * and Quickstep.
  31.  *
  32.  * @see SlowWaltz
  33.  * @see Tango
  34.  * @see SlowFox
  35.  * @see Quickstep
  36.  *
  37.  * @version 1.1, 13 Sep 1995
  38.  * @author Georg Heßmann
  39.  */
  40. class Figur implements Runnable {
  41.  
  42.   Dance  app;
  43.  
  44.   /* wurde diese Figur schon jemals angezeigt? */
  45.   boolean everPaint = false;
  46.  
  47.   /* Parket fuer den Herrn und die Dame */
  48.   Floor  hfloor;
  49.   Floor  dfloor;
  50.  
  51.   /* erstmal eine Beschreibung des Tanzes */
  52.  
  53.   /**
  54.    * Is this dance a 3/4 dance (e.g. slow waltz) (=> Takte = 3)
  55.    * or a 4/4 dance (e.g. quickstep) (=> Takte = 4)
  56.    */
  57.   
  58.   public int  Takte;        // 3/4 = 3, 4/4 = 4
  59.   int          Tempo;        // Takte pro Minute
  60.  
  61.   /**
  62.    * beats per minute == Takte * Tempo
  63.    */
  64.   public int  BPM;        // Schlaege pro Minute (== Takte * Tempo)
  65.   
  66.   int         AudioTempo;    // speed of the audio file
  67.   int         SlowMotionTempo;    // speed in slow motion mode
  68.  
  69.   InputStream audio;
  70.  
  71.   /* nun eine Beschreibung der Figur */
  72.   int    CurrentFig;        // Pointer in der FigNames Liste
  73.  
  74.   int    num_hsteps;
  75.   Step   hsteps[];
  76.   int    hcount;
  77.   float  htime;
  78.   
  79.   int    num_dsteps;        // how much steps are maximal available?
  80.   Step   dsteps[];
  81.   int    dcount;        // how much steps are done?
  82.   float  dtime;            // how much time is spend?
  83.  
  84.   Thread hthread = null;    // play-dance threads
  85.   Thread dthread = null;
  86.  
  87.   Sound  sound;
  88.   int    NumXPos;        // Koo. of the number-window
  89.   int    NumYPos;
  90.   boolean isNumBorder = false;    // ist der Nummern-Hintergrund gezeichnet?
  91.  
  92.   int addRightSpace = 0;    // zusaetzlicher Platz am rechten Rand
  93.  
  94.   String NameFigur;        // e.g. natural turn
  95.   String NameDance;        // e.g. english waltz
  96.   String DameStr;        // Dame/Lady
  97.   String HerrStr;        // Herr/Gent
  98.  
  99.   boolean inSingleStep = false;
  100.   float   SingleStepTime;            // bis dahin wurde gesteppt
  101.   float   SingleStepTimeD, SingleStepTimeH;    // bis dahin hat Dame/Herr gesteppt
  102.  
  103.  
  104.   /** comment time strings for all steps */
  105.   final static String TS_n  = null;
  106.   final static String TS_1  = "1";
  107.   final static String TS_2  = "1-2";
  108.   final static String TS_2a = "1-2-&";
  109.   final static String TS_a3 = "1-2-&-3";
  110.   final static String TS_3  = "1-2-3";
  111.   final static String TS_4  = "1-2-3-4";
  112.   final static String TS_s  = "slow";
  113.   final static String TS_q  = "quick";
  114.   final static String TS_qa = "quick-&";
  115.   final static String TS_a  = "&";
  116.   final static String TS_aq = "&-quick";
  117.  
  118.   /** comment heel/toe strings for all steps */
  119.   final static String HT_str[][] = {
  120.     { "heal", "toe", "heal, toe", "toe, heal",
  121.       "inside edge toe, heal", "inside edge feet", "whole feet",
  122.       "inside edge toe", "toe, heal, toe",
  123.       "heal, inside edge feet, whole feet" },
  124.     { "Ferse", "Ballen", "Ferse, Ballen", "Ballen, Ferse",
  125.       "Innenk. Ballen, Ferse", "Innenk. Fu▀", "ganzer Fu▀",
  126.       "Innenk. Ballen", "Ballen, Ferse, Ballen",
  127.       "Ferse, Innenk. Fu▀, ganzer Fu▀" }
  128.   };
  129.   
  130.   final static int HT_n   = -1;
  131.   final static int HT_h   = 0;
  132.   final static int HT_t   = 1;
  133.   final static int HT_ht  = 2;
  134.   final static int HT_th  = 3;
  135.   final static int HT_ith = 4;
  136.   final static int HT_if  = 5;
  137.   final static int HT_wf  = 6;
  138.   final static int HT_it  = 7;
  139.   final static int HT_tht = 8;
  140.   final static int HT_hiw = 9;
  141.   
  142.  
  143.   /**
  144.    * Constructor initialize some always needed variables.
  145.    * @param app pointer to the main dance applet (e.g. needed
  146.    *            for Dance.engl
  147.    */
  148.   protected Figur(Dance app)
  149.   {
  150.     this.app  = app;
  151.     everPaint = false;
  152.  
  153.     DameStr = (app.engl) ? "Lady" : "Dame";
  154.     HerrStr = (app.engl) ? "Gent" : "Herr";
  155.  
  156.     /* x,y Koo. of the takt window */
  157.     NumXPos = 30;
  158.     NumYPos = 50;
  159.   }
  160.  
  161.   /**
  162.    * Calculate waiting time.
  163.    * Gets a float time number relative to the dance tact and
  164.    * returns the waiting time in milli secs.
  165.    * @param time time relative to the dance tact
  166.    * @return waiting time in milli secs.
  167.    */
  168.   public long CalcWTime(float time)
  169.   {
  170.     return (long)(time * 1000.0f * 60.0f / (float)BPM + 0.5f);
  171.   }
  172.  
  173.   
  174.   /**
  175.    * Next non zero (german: Null) time.
  176.    * Looks from the current step forward for the next step with
  177.    * waiting time greater zero.
  178.    * @return next non zero waiting time. If no such time exists,
  179.    *  return one.
  180.    */
  181.   public float NextNNTime()
  182.   {
  183.     int i;
  184.     float t = 1;
  185.  
  186.     i = hcount;
  187.     while (i<num_hsteps && hsteps[i].time_step == 0) i++;
  188.     if (i<num_hsteps) t = hsteps[i].time_step;
  189.  
  190.     i = dcount;
  191.     while (i<num_dsteps && dsteps[i].time_step == 0) i++;
  192.     if (i<num_dsteps && dsteps[i].time_step < t) t = dsteps[i].time_step;
  193.  
  194.     return t;
  195.   }
  196.   
  197.  
  198.   /**
  199.    * Previsious non zero (german: Null) waiting time.
  200.    * Looks from the current step backward to find the next (smalles)
  201.    * waiting time greater zero.
  202.    * @return previsious waiting time greater zero. Returns zero, if no such
  203.    *  time exists.
  204.    */
  205.   public float PrevNNTime()
  206.   {
  207.     int i;
  208.     float td = 0;
  209.     float th = 0;
  210.  
  211.     i = hcount-1;
  212.     while (i>0 && hsteps[i].time_step == 0) i--;
  213.     if (i>0) th = hsteps[i].time_step;
  214.  
  215.     i = dcount-1;
  216.     while (i>0 && dsteps[i].time_step == 0) i--;
  217.     if (i>0) td = dsteps[i].time_step;
  218.  
  219.     return Math.min(th, td);
  220.   }
  221.  
  222.   /**
  223.    * Does one step on the male (Gent) floor.
  224.    * @return the waiting time until the next male step is to do
  225.    *  or -1 if there was no step to do. (The last step has a waiting
  226.    *  time > 0 too, so -1 comes, if there was already no step to do.)
  227.    */
  228.   public float DoHStep()
  229.   {
  230.     if (hcount >= num_hsteps) return -1;
  231.     else {
  232.       hfloor.doStep(hsteps[hcount]);
  233.       htime += hsteps[hcount].time_step;
  234.       return hsteps[hcount++].time_step;
  235.     }
  236.   }
  237.  
  238.  
  239.   /**
  240.    * Does one step on the female (Lady) floor.
  241.    * @return the waiting time until the next female step is to do
  242.    *  or -1 if there was no step to do. (The last step has a waiting
  243.    *  time > 0 too, so -1 comes, if there was already no step to do.)
  244.    */
  245.   public float DoDStep()
  246.   {
  247.     if (dcount >= num_dsteps) return -1;
  248.     else {
  249.       dfloor.doStep(dsteps[dcount]);
  250.       dtime += dsteps[dcount].time_step;
  251.       return dsteps[dcount++].time_step;
  252.     }
  253.   }
  254.  
  255.  
  256.   /**
  257.    * Does on step forward (in single step mode)
  258.    */
  259.   public void stepForw()
  260.   {
  261.     ShowComStr();
  262.     
  263.     if (ThreadsAlive()) {
  264.       // laeuft noch ein play
  265.       StopDance();
  266.     }
  267.  
  268.     if (!inSingleStep) {
  269.       inSingleStep = true;
  270.       SingleStepTime = SingleStepTimeD = SingleStepTimeH = 0;
  271.     }
  272.  
  273.     float next = NextNNTime();
  274.     SingleStepTime += (next > 1) ? 1 : next;
  275.  
  276.     float td = 0, th = 0;
  277.  
  278.     while (SingleStepTimeH < SingleStepTime && th >= 0) {
  279.       th += DoHStep();
  280.       SingleStepTimeH += th;
  281.     }
  282.  
  283.     while (SingleStepTimeD < SingleStepTime && td >= 0) {
  284.       td += DoDStep();
  285.       SingleStepTimeD += td;
  286.     }
  287.  
  288.     SetCounter((int)Math.ceil(SingleStepTime));
  289.  
  290.     if (th < 0 && td < 0) {
  291.       inSingleStep = false;
  292.       SetCounter(-1);
  293.       HideComStr();
  294.     }
  295.   }
  296.   
  297.   
  298.   /**
  299.    * Take one step backward (in single step mode).
  300.    * If not in single step mode, do all steps and go into single step mode.
  301.    */
  302.   public void stepBackw()
  303.   {
  304.     ShowComStr();
  305.     
  306.     if (ThreadsAlive() || !inSingleStep || (inSingleStep && SingleStepTime == 0)) {
  307.       /* laeuft noch ein play, oder noch kein single step */
  308.  
  309.       StopDance();    // alle Schritte anzeigen
  310.  
  311.       inSingleStep = true;
  312.       SingleStepTime = SingleStepTimeD = SingleStepTimeH = timeSpend();
  313.       SetCounter((int)Math.floor(timeSpend()));
  314.     }
  315.     else {
  316.  
  317.       float pt = PrevNNTime();
  318.  
  319.       if (pt > 1) pt = 1;    // go only one time step at a time
  320.  
  321.       /* add current waiting to and accumulated waiting time */
  322.       float ptd = SingleStepTimeD - SingleStepTime + pt;
  323.       float pth = SingleStepTimeH - SingleStepTime + pt;
  324.  
  325.       int   h      = hcount-1;
  326.       float htdiff = 0;
  327.  
  328.       while (h >= 0 && htdiff + hsteps[h].time_step <= pth) {
  329.     htdiff += hsteps[h].time_step;
  330.     hfloor.backStep();
  331.     h--;
  332.       }
  333.  
  334.       int   d      = dcount-1;
  335.       float dtdiff = 0;
  336.  
  337.       while (d >= 0 && dtdiff + dsteps[d].time_step <= ptd) {
  338.     dtdiff += dsteps[d].time_step;
  339.     dfloor.backStep();
  340.     d--;
  341.       }
  342.  
  343.       /* h, d werden nun das neue hcount, dcount */
  344.       /* es werden also hcount-h bzw. dcount-d Schritte zurueck genommen */
  345.  
  346.       hcount = h+1;
  347.       dcount = d+1;
  348.  
  349.       htime -= htdiff;
  350.       dtime -= dtdiff;
  351.  
  352.       SingleStepTime -= pt;
  353.       SingleStepTimeD = dtime;
  354.       SingleStepTimeH = htime;
  355.  
  356.       SetCounter((int)SingleStepTime);
  357.     }
  358.   }
  359.  
  360.   /** Are we in single step mode? */
  361.   public boolean inSingleStep()    { return inSingleStep; }
  362.  
  363.   /** Leave the single step mode. Needed initializations does the Dance class */
  364.   public void leaveSingleStep() { inSingleStep = false; }
  365.   
  366.  
  367.   /**
  368.    * Clear all done steps. After the next repaint(), no feeds are on the floors.
  369.    */
  370.   public void clearSteps()
  371.   {
  372.     hfloor.clearSteps();
  373.     dfloor.clearSteps();
  374.     
  375.     /* wieviele Schritte wurden gemacht */
  376.     hcount = 0;
  377.     dcount = 0;
  378.     
  379.     /* wieviel Zeit ist verstrichen */
  380.     htime  = 0;
  381.     dtime  = 0;
  382.   }
  383.  
  384.   /**
  385.    * How much time is currently spend (usefull in single step mode).
  386.    */
  387.   private float timeSpend()    { return Math.max(htime, dtime);  }
  388.  
  389.   /**
  390.    * Show the takt/time string (slow/quick or heel/toe) on both floors.
  391.    * @see Floor#ShowComStr
  392.    */
  393.   public void ShowComStr()
  394.   {
  395.     hfloor.ShowComStr();
  396.     dfloor.ShowComStr();
  397.   }
  398.  
  399.   /**
  400.    * Hide the takt/time string (slow/quick or heel/toe) on both floors.
  401.    * @see Floor#HideComStr
  402.    */
  403.   public void HideComStr()
  404.   {
  405.     hfloor.HideComStr();
  406.     dfloor.HideComStr();
  407.   }
  408.  
  409.  
  410.   /**
  411.    * Use the heel/toe string for the comment field.
  412.    * @see Floor#useComStrHT
  413.    */
  414.   public void useComStrHT()
  415.   {
  416.     hfloor.useComStrHT();
  417.     dfloor.useComStrHT();
  418.   }
  419.  
  420.   /**
  421.    * Use the time (slow/quick) string for the comment field.
  422.    * @see Floor#useComStrTime
  423.    */
  424.   public void useComStrTime()
  425.   {
  426.     hfloor.useComStrTime();
  427.     dfloor.useComStrTime();
  428.   }
  429.   
  430.  
  431.   /**
  432.    * Main function for the animation feature.
  433.    * This function will be started twice. As well for the male
  434.    * thread (thread name "Herr") an for the female thread (thread name "Dame").
  435.    * It does step by step and sleep() between the steps. repaint() is
  436.    * only needed, if the waiting time is an fraction of the takt because
  437.    * the sound thread already does a repaint every takt beat.
  438.    * If all steps are set, the threads does kill themself and, if it was the
  439.    * last thread, the sound thread will also be killed.
  440.    */
  441.   public void run()
  442.   {
  443.     float wfl;                // wait time in beats
  444.     long wtime;                // wait time in millis
  445.     long stime = System.currentTimeMillis();    // start time in millis
  446.     long ctime;                // current time in millis
  447.  
  448.  
  449.     if (Thread.currentThread().getName().compareTo("Herr") == 0) {
  450.  
  451.       do {
  452.     int step = 1;
  453.     int done = 0;
  454.     
  455.     wfl = DoHStep();
  456.     wtime = CalcWTime(wfl);
  457.     step++;
  458.     
  459.     if (wtime > 0) {
  460.       done = step;
  461.       
  462.       // classs Sound already does a repaint() all x.0f timesteps
  463.       if (wfl != Math.floor(wfl)) app.repaint();
  464.       
  465.       ctime = System.currentTimeMillis();
  466.       try {
  467.         Thread.sleep(wtime - (ctime-stime));
  468.       }
  469.       catch (InterruptedException e) {
  470.         wtime = -1;
  471.       }
  472.       stime = System.currentTimeMillis();
  473.     }
  474.       } while(wtime >= 0);
  475.       app.repaint();        // wg. dem letzten Fuss
  476.       
  477.       // ziehe mir den Boden unter den Fuessen weg -- aber ich bin nun fertig
  478.       hthread = null;
  479.     }
  480.     else {
  481.       do {
  482.     int step = 1;
  483.     int done = 0;
  484.  
  485.     wfl = DoDStep();
  486.     wtime = CalcWTime(wfl);
  487.     step++;
  488.  
  489.     if (wtime > 0) {
  490.       done = step;
  491.  
  492.       // classs Sound already does a repaint() all x.0f timesteps
  493.       if (wfl != Math.floor(wfl)) app.repaint();
  494.  
  495.       ctime = System.currentTimeMillis();
  496.         try {
  497.         Thread.sleep(wtime - (ctime-stime));
  498.       }
  499.       catch (InterruptedException e) {
  500.         wtime = -1;
  501.       }
  502.       stime = System.currentTimeMillis();
  503.     }
  504.       } while(wtime >= 0);
  505.       app.repaint();        // wg. dem letzten Fuss
  506.  
  507.       // ziehe mir den Boden unter den Fuessen weg -- aber ich bin nun fertig
  508.       dthread = null;
  509.     }
  510.  
  511.     if (!ThreadsAlive()) sound.StopSound(); // AfterNextTakt();
  512.   }
  513.  
  514.  
  515.   /**
  516.    * Start the animation.
  517.    * Set the tempo/BPM, starts the male/female threads and
  518.    * than start the sound thread.
  519.    */
  520.   public synchronized void Dance()
  521.   {
  522.     ShowComStr();
  523.  
  524.     if (app.useAudio()) {
  525.       Tempo = AudioTempo;
  526.     }
  527.     else {
  528.       Tempo = SlowMotionTempo;
  529.     }
  530.     BPM = Tempo * Takte;
  531.  
  532.     dthread = new Thread(this, "Dame");
  533.     dthread.setPriority(Thread.MAX_PRIORITY-2);
  534.     hthread = new Thread(this, "Herr");
  535.     hthread.setPriority(Thread.MAX_PRIORITY-2);
  536.     
  537.     dthread.start();
  538.     hthread.start();
  539.  
  540.     sound.StartSound();
  541.   }
  542.  
  543.   /**
  544.    * Stop the animation. E.g. if the "play" button is hit while
  545.    * an animation still runs, the animation will be aborted.
  546.    * Than all missing steps are done quickly.
  547.    */
  548.   public synchronized void StopDance()
  549.   {
  550.     HideComStr();
  551.     
  552.     if (dthread != null && dthread.isAlive()) dthread.stop();
  553.     if (hthread != null && hthread.isAlive()) hthread.stop();
  554.     
  555.     dthread = null;
  556.     hthread = null;
  557.  
  558.     /* alle Schritte noch schnell zu Ende anzeigen */
  559.     while (DoDStep() >= 0 || DoHStep() >= 0) ;
  560.  
  561.     sound.StopSound();
  562.   }
  563.  
  564.  
  565.   /**
  566.    * Is at least one of the dancing threads (male/female) alive?
  567.    */
  568.   public boolean ThreadsAlive()
  569.   {
  570.     return (hthread != null || dthread != null);
  571.   }
  572.  
  573.   /**
  574.    * Set the time counter value. Needed in single step mode.
  575.    * Counter value -1 means, hide the counter window.
  576.    */
  577.   public void SetCounter(int c)
  578.   {
  579.     if (sound != null) sound.SetCounter(c);
  580.   }
  581.     
  582.  
  583.   /**
  584.    * Draw the dance and figur name on the top of the applet.
  585.    */
  586.   public void drawTitel(Graphics g)
  587.   {
  588.     Font oldf = g.getFont();
  589.     if (app.choiceFont != null) {
  590.       g.setFont(app.choiceFont);
  591.     }
  592.  
  593.     g.drawString(NameDance + " / " + NameFigur, 10, 30);
  594.     g.setFont(oldf);
  595.   }
  596.  
  597.   /**
  598.    * Draw the time/takt number. The value of this counter is
  599.    * maintained from the sound class.
  600.    * @param g actual graphics context
  601.    * @param update only an update or an whole repaint
  602.    * @see Sound
  603.    * @see Sound#GetNumImg
  604.    */
  605.   public void drawNum(Graphics g, boolean update)
  606.   {
  607.     Image curImg = sound.GetNumImg();
  608.     
  609.     if (!update) isNumBorder = false;    // bei paint() auch Hintergrund zeichnen!
  610.     
  611.     if (!update || curImg != sound.getLastNumImg()) {
  612.       if (curImg != null) {
  613.     if (!isNumBorder) {
  614.       isNumBorder = true;
  615.       g.setColor(Color.white);
  616.       g.fillRect(NumXPos, NumYPos+1, sound.numMaxW+20, sound.numMaxH+10);
  617.       g.setColor(Color.black);
  618.       g.drawRect(NumXPos-1, NumYPos,sound.numMaxW+21, sound.numMaxH+11);
  619.     }
  620.     g.drawImage(curImg, NumXPos+1+13, NumYPos+11, sound);
  621.       }
  622.       else {
  623.     isNumBorder = false;
  624.     g.clearRect(NumXPos-1, NumYPos, sound.numMaxW+20+2, sound.numMaxH+10+2);
  625.       }
  626.       sound.setLastNumImg(curImg);
  627.     }
  628.   }
  629.  
  630.   /** Return the left edge of the male floor */
  631.   public int LeftEdge()   { return hfloor.LeftEdge(); }
  632.   /** Return the right edge of the female floor (plus some additional space */
  633.   public int RightEdge()  { return dfloor.RightEdge() + addRightSpace; }
  634.   /** Return the bottom edge of the floors. */
  635.   public int BottomEdge() { return dfloor.BottomEdge(); }
  636.  
  637.  
  638.   /**
  639.    * Returns a String object representing.
  640.    */
  641.   public String toString()
  642.   {
  643.     return getClass().getName() +
  644.       "[NameDance=" + NameDance + ", NameFigur=" + NameFigur +
  645.       ", Takte=" + Takte +
  646.       ", Tempo=" + Tempo + ", BPM=" + BPM +
  647.       ", singel-step=" + inSingleStep + ", SSTime=" + SingleStepTime +
  648.       ", H-Tread=" + hthread + ", D-Thread=" + dthread + "]";
  649.   }
  650. }
  651.  
  652.  
  653. /*
  654.  ********************************************************
  655.  *     SLOW WALZ                    *
  656.  ********************************************************
  657.  */
  658.  
  659. /**
  660.  * Slow Waltz: Stores the information of the slow waltz figures.<P>
  661.  *
  662.  * To initialize a spezial figur:
  663.  * <pre>
  664.  *   Figur figur = new SlowWaltz(app, figNum, tempo, audioURL);
  665.  * </pre>
  666.  * Whereat app the applet pointer is, figNum the number of the
  667.  * slow waltz figur you want, tempo the speed of the sound defined
  668.  * by the audioURL.<p>
  669.  *
  670.  * To add a new figur:
  671.  * <ol>
  672.  *  <li>Add the name of the figur into FigNames_{eng,ger}.
  673.  *  <li>Add an initialization function (use initNatTurn as template)
  674.  *  <li>Add your initialization function into the switch statement of
  675.  *     the constructor.
  676.  * </ol>
  677.  * If you don't have more than 4 figures, you don't have to change anything
  678.  * in class Dance. If you have more figures, you only have to add more space
  679.  * for the figur-buttons.
  680.  *
  681.  * @version 1.0f 25 Aug 1995
  682.  * @author Georg Heßmann
  683.  */
  684. class SlowWaltz extends Figur {
  685.  
  686.   /** English name of this dance. */
  687.   public final static String Name_eng       = "English Waltz";
  688.   /** German name of this dance. */
  689.   public final static String Name_ger       = "Langsamer Walzer";
  690.   /** Array of the english names of all implemented figures. */
  691.   public final static String FigNames_eng[] = { "Natural Turn",  "Whisk" };
  692.   /** Array of the german names of all implemented figures. */
  693.   public final static String FigNames_ger[] = { "Rechtsdrehung", "Wischer" };
  694.  
  695.  
  696.   /**
  697.    * Initialze a dance and select a special figur out of this dance.
  698.    * @param app pointer to the dance applet.
  699.    * @param danceNum number of the choosen figur. The number is defined
  700.    *        relative to the names in the FigNames_* array.
  701.    * @param tempo of the given audio file
  702.    * @param audioURL URL description of the given audio file.
  703.    *        Might be null if "no music" is selected.
  704.    */
  705.   public SlowWaltz(Dance app, int danceNum, int temp, URL audioURL)
  706.   {
  707.     super(app);
  708.     
  709.     Takte  = 3;
  710.  
  711.     CurrentFig = danceNum;
  712.     
  713.     SlowMotionTempo = 20;
  714.     AudioTempo      = temp;
  715.     
  716.     NameDance  = (app.engl) ? Name_eng : Name_ger;
  717.     NameFigur  = (app.engl) ? FigNames_eng[CurrentFig] : FigNames_ger[CurrentFig];
  718.     
  719.     sound = new Sound(audioURL, app);
  720.  
  721.     int LeftEdge = 2*NumXPos + sound.numMaxW + 20;
  722.     int TopEdge  = NumYPos;
  723.  
  724.     /* initialize dance (floor size, steps) */
  725.     switch (danceNum) {
  726.      case 0:
  727.       initNaturalTurn(LeftEdge, TopEdge);
  728.       break;
  729.      case 1:
  730.       initWhisk(LeftEdge, TopEdge);
  731.       break;
  732.     }
  733.   }
  734.  
  735.  
  736.   /**
  737.    * Returns a String object representing.
  738.    */
  739.   public String toString()
  740.   { 
  741.     return getClass().getName() + "[Figur=" + super.toString() + "]";
  742.   }
  743.  
  744.  
  745.   private void initNaturalTurn(int LeftEdge, int TopEdge)
  746.   {
  747.     hfloor = new Floor(HerrStr, false, LeftEdge, TopEdge,
  748.                2, 4, 30, 30, 30, 30, app.foots, app);
  749.     dfloor = new Floor(DameStr, true,  hfloor.RightEdge()+20, TopEdge,
  750.                2, 4, 30, 30, 30, 30, app.foots, app);
  751.  
  752.     // Tanzrichtung-Pfeile setzen
  753.     hfloor.SetTRPos(1.4f,  3.2f);
  754.     dfloor.SetTRPos(1.55f, 3.2f);
  755.  
  756.     hfloor.SetComStrPos(0.2f, -0.1f);
  757.     dfloor.SetComStrPos(0.2f, -0.1f);
  758.  
  759.  
  760.     // Herren-Schritte der Figur
  761.     num_hsteps = 11;
  762.     hsteps = new Step[num_hsteps];
  763.  
  764.     hsteps[0]  = new Step(0, true,  false, Foot.NO, -0.25f,  4.15f, TS_n, HT_n);
  765.     hsteps[1]  = new Step(3, false, false, Foot.NO, -0.1f,   4.25f, TS_n, HT_n);  // Aufstellung
  766.     hsteps[2]  = new Step(1, false, false, Foot.NO,  0.82f,  3.18f, TS_1, HT_ht); // r vorw
  767.     hsteps[3]  = new Step(0, false, true,  Foot.SO,  0.83f,  2.98f, TS_2, HT_ht); // r drehen
  768.     hsteps[4]  = new Step(1, true,  false, Foot.SO,  1.90f,  2.05f, TS_2, HT_t);  // l vorw
  769.     hsteps[5]  = new Step(0, true,  true,  Foot.S,   2.0f,   2.0f,  TS_3, HT_t);  // l drehen
  770.     hsteps[6]  = new Step(1, false, false, Foot.S,   1.8f,   2.0f,  TS_3, HT_th); // r vorw schl
  771.     hsteps[7]  = new Step(1, true,  false, Foot.SSW, 2.1f,   0.9f,  TS_1, HT_th); // l rueck
  772.     hsteps[8]  = new Step(0, true,  true,  Foot.SWW, 2.18f,  0.95f, TS_1, HT_th); // l drehen
  773.     hsteps[9]  = new Step(1, false, false, Foot.NW,  2.2f,   0,    TS_2, HT_t);  // r rueck
  774.     hsteps[10] = new Step(1, true,  false, Foot.NW,  2.1f,   0.12f, TS_3, HT_th); // l rueck schl
  775.  
  776.     // Damen-Schritte der Figur
  777.     num_dsteps = 11;
  778.     dsteps = new Step[num_dsteps];
  779.  
  780.     dsteps[0]  = new Step(0, true,  false, Foot.SW, 0.26f, 3.89f, TS_n, HT_n);
  781.     dsteps[1]  = new Step(3, false, false, Foot.SW, 0.14f, 3.83f, TS_n, HT_n);   // Aufstellung
  782.     dsteps[2]  = new Step(1, true,  false, Foot.SW, 1.25f, 2.92f, TS_1, HT_th);  // l rueck
  783.     dsteps[3]  = new Step(0, true,  true,  Foot.NW, 1.25f, 3.1f,  TS_2, HT_th);  // l drehen
  784.     dsteps[4]  = new Step(1, false, false, Foot.N,  2,    2.5f,  TS_2, HT_t);   // r rueck
  785.     dsteps[5]  = new Step(1, true,  false, Foot.N,  1.85f, 2.5f,  TS_3, HT_th);  // l ran
  786.     dsteps[6]  = new Step(1, false, false, Foot.N,  1.9f,  1.3f,  TS_1, HT_ht);  // r vorw
  787.     dsteps[7]  = new Step(0, false, true,  Foot.O,  1.8f,  1.2f,  TS_2, HT_ht);  // r drehen
  788.     dsteps[8]  = new Step(1, true,  false, Foot.O,  1.80f,-0.1f,  TS_2, HT_t);   // l vorw
  789.     dsteps[9]  = new Step(0, true,  true,  Foot.SO, 1.80f,-0.18f, TS_3, HT_t);   // l drehen
  790.     dsteps[10] = new Step(1, false, false, Foot.SO, 1.72f,-0.1f,  TS_3, HT_th);  // r ran
  791.   }
  792.  
  793.  
  794.   private void initWhisk(int LeftEdge, int TopEdge)
  795.   {
  796.     hfloor = new Floor(HerrStr, false, LeftEdge, TopEdge,
  797.                3, 4, 30, 30, 30, 30, app.foots, app);
  798.     dfloor = new Floor(DameStr, true,  hfloor.RightEdge()+20, TopEdge,
  799.                3, 4, 30, 30, 30, 30, app.foots, app);
  800.  
  801.     // Tanzrichtung-Pfeile setzen
  802.     hfloor.SetTRPos(0.2f, 0.2f);
  803.     dfloor.SetTRPos(0.2f, 0.2f);
  804.  
  805.     hfloor.SetComStrPos(0.2f, -0.1f);
  806.     dfloor.SetComStrPos(0.2f, -0.1f);
  807.  
  808.  
  809.     // Herren-Schritte der Figur
  810.     num_hsteps = 10;
  811.     hsteps = new Step[num_hsteps];
  812.  
  813.     hsteps[0]  = new Step(0, true,  false, Foot.NO, -0.25f, 4.15f, TS_n,  HT_n);
  814.     hsteps[1]  = new Step(3, false, false, Foot.NO, -0.1f,  4.25f, TS_n,  HT_n);    // Aufstellung
  815.     hsteps[2]  = new Step(1, true,  false, Foot.NO,  0.82f, 3.18f, TS_1,  HT_ht);    // l vorw
  816.     hsteps[3]  = new Step(1, false, false, Foot.NO,  1.7f,  3.74f, TS_2,  HT_t);    // r vorw/seitw
  817.     hsteps[4]  = new Step(1, true,  false, Foot.NO,  1.69f, 4.1f,  TS_3,  HT_th);    // l hinter
  818.     hsteps[5]  = new Step(1, false, false, Foot.NO,  1.8f,  3.0f,  TS_1,  HT_ht);  // r vorw
  819.     hsteps[6]  = new Step(.5f,true,  false, Foot.NO,  1.7f,  1.95f, TS_2,  HT_t);  // l vorw
  820.     hsteps[7]  = new Step(.5f,false, false, Foot.NO,  1.75f, 2.15f, TS_2a, HT_t);  // r ran (und)
  821.     hsteps[8]  = new Step(1, true,  false, Foot.NO,  1.7f,  1.0f,  TS_a3, HT_th); // l vorw
  822.     hsteps[9]  = new Step(1, false, false, Foot.NNO, 2.4f,  0.0f,  TS_1,  HT_ht);  // r vorw
  823.  
  824.     // Damen-Schritte der Figur
  825.     num_dsteps = 12;
  826.     dsteps = new Step[num_dsteps];
  827.  
  828.     dsteps[0]  = new Step(0, true,  false, Foot.SW, 0.26f, 3.89f, TS_n,  HT_n);
  829.     dsteps[1]  = new Step(3, false, false, Foot.SW, 0.14f, 3.83f, TS_n,  HT_n);    // Aufstellung
  830.     dsteps[2]  = new Step(1, false, false, Foot.SW, 1.25f, 2.92f, TS_1,  HT_th);    // r rueck
  831.     dsteps[3]  = new Step(0, false, true,  Foot.W,  1.26f, 3.0f,  TS_2,  HT_th);    // r drehen
  832.     dsteps[4]  = new Step(1, true,  false, Foot.NW, 2.1f,  3.7f,  TS_2,  HT_t);    // l rueck
  833.     dsteps[5]  = new Step(1, false, false, Foot.NW, 2.15f, 4.0f,  TS_3,  HT_th);    // r hinter
  834.     dsteps[6]  = new Step(1, true,  false, Foot.NW, 2.18f, 2.95f, TS_1,  HT_ht);    // l seitw
  835.     dsteps[7]  = new Step(.5f,false, false, Foot.W,  2.22f, 1.97f, TS_2,  HT_t);    // r seitw
  836.     dsteps[8]  = new Step(0, false, true,  Foot.SWW,2.2f,  1.95f, TS_2a, HT_t);    // r drehen
  837.     dsteps[9]  = new Step(.5f,true,  false, Foot.SWW,2.23f, 2.1f,  TS_2a, HT_t);    // l ran
  838.     dsteps[10] = new Step(1, false, false, Foot.SW, 2.3f,  0.85f, TS_a3, HT_th);    // r seitw
  839.     dsteps[11] = new Step(1, true,  false, Foot.SSW,2.8f, -0.2f,  TS_1,  HT_th);    // l rueck
  840.   }
  841. }
  842.  
  843.  
  844. /*
  845.  ********************************************************
  846.  *     TANGO                        *
  847.  ********************************************************
  848.  */
  849.  
  850. /**
  851.  * Tango: Stores the information of the tango figures.<P>
  852.  *
  853.  * To initialize a spezial figur:
  854.  * <pre>
  855.  *   Figur figur = new Tango(app, figNum, tempo, audioURL);
  856.  * </pre>
  857.  * Whereat app the applet pointer is, figNum the number of the
  858.  * tango figur you want, tempo the speed of the sound defined
  859.  * by the audioURL.<p>
  860.  *
  861.  * To add a new figur:
  862.  * <ol>
  863.  *  <li>Add the name of the figur into FigNames_{eng,ger}.
  864.  *  <li>Add an initialization function (use initLeftTurn as template)
  865.  *  <li>Add your initialization function into the switch statement of
  866.  *     the constructor.
  867.  * </ol>
  868.  * If you don't have more than 4 figures, you don't have to change anything
  869.  * in class Dance. If you have more figures, you only have to add more space
  870.  * for the figur-buttons.
  871.  *
  872.  * @version 1.0f 25 Aug 1995
  873.  * @author Georg Heßmann
  874.  */
  875. class Tango extends Figur {
  876.   
  877.   /** English name of this dance. */
  878.   public final static String Name_eng       = "Tango";
  879.   /** German name of this dance. */
  880.   public final static String Name_ger       = "Tango";
  881.   /** Array of the english names of all implemented figures. */
  882.   public final static String FigNames_eng[] = { "Left Turn", "Rock Turn",
  883.                         "Outside Swivel, Brush Tap" };
  884.   /** Array of the german names of all implemented figures. */
  885.   public final static String FigNames_ger[] = { "Linksdrehung",
  886.                         "Wiegeschrittdrehung",
  887.                         "Linksgedrehte Kehre + Brush Tap" };
  888.   
  889.   /**
  890.    * Initialze a dance and select a special figur out of this dance.
  891.    * @param app pointer to the dance applet.
  892.    * @param danceNum number of the choosen figur. The number is defined
  893.    *        relative to the names in the FigNames_* array.
  894.    * @param tempo of the given audio file
  895.    * @param audioURL URL description of the given audio file.
  896.    *        Might be null if "no music" is selected.
  897.    */
  898.   public Tango(Dance app, int danceNum, int temp, URL audioURL)
  899.   {
  900.     super(app);
  901.  
  902.     Takte  = 4;
  903.  
  904.     CurrentFig = danceNum;
  905.     
  906.     SlowMotionTempo = 18;
  907.     AudioTempo      = temp;
  908.     
  909.     NameDance  = (app.engl) ? Name_eng : Name_ger;
  910.     NameFigur  = (app.engl) ? FigNames_eng[CurrentFig] : FigNames_ger[CurrentFig];
  911.     
  912.     sound = new Sound(audioURL, app);
  913.  
  914.     int LeftEdge = 2*NumXPos + sound.numMaxW + 20;
  915.     int TopEdge  = NumYPos;
  916.  
  917.     /* initialize dance (floor size, steps) */
  918.     switch (danceNum) {
  919.      case 0:
  920.       initLeftTurn(LeftEdge, TopEdge);
  921.       break;
  922.      case 1:
  923.       initRockTurn(LeftEdge, TopEdge);
  924.       break;
  925.      case 2:
  926.       initOutsideSwivel(LeftEdge, TopEdge);
  927.       break;
  928.     }
  929.   }
  930.  
  931.  
  932.  
  933.   /**
  934.    * Returns a String object representing.
  935.    */
  936.   public String toString()
  937.   { 
  938.     return getClass().getName() + "[Figur=" + super.toString() + "]";
  939.   }
  940.  
  941.  
  942.   
  943.   private void initLeftTurn(int LeftEdge, int TopEdge)
  944.   {
  945.     hfloor = new Floor(HerrStr, false, LeftEdge, TopEdge,
  946.                2, 4, 30, 30, 30, 30, app.foots, app);
  947.     dfloor = new Floor(DameStr, true,  hfloor.RightEdge()+20, TopEdge,
  948.                2, 4, 30, 30, 30, 30, app.foots, app);
  949.  
  950.     // Tanzrichtung-Pfeile setzen
  951.     hfloor.SetTRPos(1.5f, 0.2f);
  952.     dfloor.SetTRPos(1.5f, 0.2f);
  953.  
  954.     hfloor.SetComStrPos(0.2f, -0.1f);
  955.     dfloor.SetComStrPos(0.2f, -0.1f);
  956.  
  957.  
  958.     // Herren-Schritte der Figur
  959.     num_hsteps = 9;
  960.     hsteps = new Step[num_hsteps];
  961.  
  962.     hsteps[0]  = new Step(0, true,  false, Foot.NW,  2.0f,   4.23f, TS_n, HT_n);
  963.     hsteps[1]  = new Step(4, false, false, Foot.NW,  2.24f,  4.23f, TS_n, HT_n);   // Aufstellung
  964.     hsteps[2]  = new Step(1, true,  false, Foot.NWW, 1.4f,   3.3f,  TS_q, HT_h);   // l vorw
  965.     hsteps[3]  = new Step(1, false, false, Foot.S,   0.7f,   2.75f, TS_q, HT_th);  // r vorw
  966.     hsteps[4]  = new Step(0, false, true,  Foot.SO,  0.66f,  2.76f, TS_s, HT_th);  // r drehen
  967.     hsteps[5]  = new Step(2, true,  false, Foot.SO,  0.60f,  2.0f,  TS_s, HT_ith); // l rueck
  968.     hsteps[6]  = new Step(1, false, false, Foot.SO,  0.0f,   1.25f, TS_q, HT_th);  // r rueck
  969.     hsteps[7]  = new Step(1, true,  false, Foot.NOO, 0.05f,  0.46f, TS_q, HT_if);  // l seitw
  970.     hsteps[8]  = new Step(2, false, false, Foot.NOO,-0.05f,  0.69f, TS_s, HT_wf);  // r ran
  971.  
  972.     // Damen-Schritte der Figur
  973.     num_dsteps = 9;
  974.     dsteps = new Step[num_dsteps];
  975.  
  976.     dsteps[0]  = new Step(0, true,  false, Foot.SO,  2.0f,  3.8f,  TS_n, HT_n);
  977.     dsteps[1]  = new Step(4, false, false, Foot.SO,  1.84f, 3.8f,  TS_n, HT_n);    // Aufstellung
  978.     dsteps[2]  = new Step(1, false, false, Foot.SOO, 0.9f,  3.2f,  TS_q, HT_th);    // r rueck
  979.     dsteps[3]  = new Step(0, false, true,  Foot.NNO, 0.95f, 3.3f,  TS_q, HT_th);    // r drehen
  980.     dsteps[4]  = new Step(1, true,  false, Foot.N,   0.75f, 3.25f, TS_q, HT_wf);    // l rueck
  981.     dsteps[5]  = new Step(2, false, false, Foot.NNW, 0.9f,  2.35f, TS_s, HT_h);    // r vorw
  982.     dsteps[6]  = new Step(1, true,  false, Foot.NW,  0.35f, 1.65f, TS_q, HT_h);    // l vorw
  983.     dsteps[7]  = new Step(1, false, false, Foot.SWW, 0.4f,  0.55f, TS_q, HT_it);    // r seitw
  984.     dsteps[8]  = new Step(2, true,  false, Foot.SWW, 0.3f,  0.73f, TS_s, HT_wf);    // l ran
  985.   }
  986.   
  987.   private void initRockTurn(int LeftEdge, int TopEdge)
  988.   {
  989.     hfloor = new Floor(HerrStr, false, LeftEdge, TopEdge,
  990.                1, 3, 30, 30, 30, 30, app.foots, app);
  991.     dfloor = new Floor(DameStr, true,  hfloor.RightEdge()+20, TopEdge,
  992.                1, 3, 30, 30, 30, 30, app.foots, app);
  993.  
  994.     // Tanzrichtung-Pfeile setzen
  995.     hfloor.SetTRPos(0.58f, 0.2f);
  996.     dfloor.SetTRPos(0.58f, 0.2f);
  997.  
  998.     hfloor.SetComStrPos(-0.25f, -0.18f);
  999.     dfloor.SetComStrPos(-0.25f, -0.18f);
  1000.  
  1001.  
  1002.     // Herren-Schritte der Figur
  1003.     num_hsteps = 9;
  1004.     hsteps = new Step[num_hsteps];
  1005.  
  1006.     hsteps[0]  = new Step(0, true,  false, Foot.NO, -0.06f,  3.0f,  TS_n, HT_n);
  1007.     hsteps[1]  = new Step(4, false, false, Foot.NO, -0.04f,  3.2f,  TS_n, HT_n);   // Aufstellung
  1008.     hsteps[2]  = new Step(2, false, false, Foot.NO,  0.95f,  2.2f,  TS_s, HT_h);   // r vorw
  1009.     hsteps[3]  = new Step(1, true,  false, Foot.O,   0.72f,  1.36f, TS_q, HT_ith); // l vorw
  1010.     hsteps[4]  = new Step(1, false, false, Foot.SOO, 0.95f,  2.08f, TS_q, HT_ith); // r seit/drehen
  1011.     hsteps[5]  = new Step(2, true,  false, Foot.SOO, 0.6f,   1.06f, TS_s, HT_ith); // l seit
  1012.     hsteps[6]  = new Step(1, false, false, Foot.O,  -0.34f,  0.87f, TS_q, HT_th);  // r rueck
  1013.     hsteps[7]  = new Step(1, true,  false, Foot.NOO,-0.19f,  0.03f, TS_q, HT_if);  // l seit/rueck
  1014.     hsteps[8]  = new Step(2, false, false, Foot.NOO,-0.3f,   0.24f, TS_s, HT_wf);  // r ran
  1015.  
  1016.     // Damen-Schritte der Figur
  1017.     num_dsteps = 9;
  1018.     dsteps = new Step[num_dsteps];
  1019.  
  1020.     dsteps[0]  = new Step(0, true,  false, Foot.SW,  0.3f,  2.9f,  TS_n, HT_n);
  1021.     dsteps[1]  = new Step(4, false, false, Foot.SW,  0.34f, 2.7f,  TS_n, HT_n);    // Aufstellung
  1022.     dsteps[2]  = new Step(2, true,  false, Foot.SW,  1.3f,  1.8f,  TS_s, HT_th);    // l rueck
  1023.     dsteps[3]  = new Step(1, false, false, Foot.W,   1.0f,  1.6f,  TS_q, HT_h);    // r rueck
  1024.     dsteps[4]  = new Step(1, true,  false, Foot.NW,  1.35f, 2.3f,  TS_q, HT_ith);    // l seit/drehen
  1025.     dsteps[5]  = new Step(2, false, false, Foot.NWW, 0.9f,  1.27f, TS_s, HT_h);    // r seit
  1026.     dsteps[6]  = new Step(1, true,  false, Foot.W,   0.18f, 1.0f,  TS_q, HT_h);    // l vorw
  1027.     dsteps[7]  = new Step(1, false, false, Foot.SWW, 0.35f, 0.05f, TS_q, HT_ith);    // r seitw
  1028.     dsteps[8]  = new Step(2, true,  false, Foot.SWW, 0.23f, 0.23f, TS_s, HT_wf);    // l ran
  1029.   }
  1030.   
  1031.   private void initOutsideSwivel(int LeftEdge, int TopEdge)
  1032.   {
  1033.     hfloor = new Floor(HerrStr, false, LeftEdge, TopEdge,
  1034.                2, 4, 30, 30, 30, 30, app.foots, app);
  1035.     dfloor = new Floor(DameStr, true,  hfloor.RightEdge()+20, TopEdge,
  1036.                2, 4, 30, 30, 30, 30, app.foots, app);
  1037.  
  1038.     // Tanzrichtung-Pfeile setzen
  1039.     hfloor.SetTRPos(1.3f, 2.2f);
  1040.     dfloor.SetTRPos(1.3f, 2.2f);
  1041.  
  1042.     hfloor.SetComStrPos(0.2f, -0.1f);
  1043.     dfloor.SetComStrPos(0.2f, -0.1f);
  1044.  
  1045.  
  1046.     addRightSpace = 15;        // rechts noch etwas mehr Platz lassen
  1047.  
  1048.     // Herren-Schritte der Figur
  1049.     num_hsteps = 13;
  1050.     hsteps = new Step[num_hsteps];
  1051.  
  1052.     hsteps[0]  = new Step(0, true,  false, Foot.NW,  2.0f,   4.23f, TS_n,  HT_n);
  1053.     hsteps[1]  = new Step(4, false, false, Foot.NW,  2.24f,  4.23f, TS_n,  HT_n);   // Aufstellung
  1054.     hsteps[2]  = new Step(1, true,  false, Foot.NWW, 1.28f,  3.35f, TS_q,  HT_h);   // l vorw
  1055.     hsteps[3]  = new Step(1, false, false, Foot.SW,  0.74f,  2.75f, TS_q,  HT_th);  // r vorw
  1056.     hsteps[4]  = new Step(0, false, true,  Foot.SO,  0.64f,  2.76f, TS_s,  HT_th);  // r drehen
  1057.     hsteps[5]  = new Step(2, true,  false, Foot.O,  -0.15f,  2.15f, TS_s,  HT_th);  // l rueck
  1058.     hsteps[6]  = new Step(0, false, true,  Foot.O,   0.66f,  2.0f,  TS_q,  HT_th);  // r axe
  1059.     hsteps[7]  = new Step(1, true,  false, Foot.NOO, 0.44f,  1.4f,  TS_q,  HT_h);   // l vorw
  1060.     hsteps[8]  = new Step(1, false, false, Foot.NOO, 0.7f,   1.5f,  TS_q,  HT_it);  // r seit
  1061.     hsteps[9]  = new Step(1, true,  false, Foot.NNO, 1.4f,   1.0f,  TS_q,  HT_n);   // l vorw
  1062.     hsteps[10] = new Step(.5f,false, false, Foot.N,   2.47f,  1.05f, TS_q,  HT_n);   // r vorw/seit
  1063.     hsteps[11] = new Step(.5f,true,  false, Foot.N,   2.25f,  1.05f, TS_a,  HT_n);   // l tap
  1064.     hsteps[12] = new Step(1, true,  false, Foot.N,   1.80f,  1.05f, TS_aq, HT_n);   // l tap
  1065.  
  1066.     // Damen-Schritte der Figur
  1067.     num_dsteps = 15;
  1068.     dsteps = new Step[num_dsteps];
  1069.  
  1070.     dsteps[0]  = new Step(0, true,  false, Foot.SO,  2.0f,  3.8f,  TS_n,  HT_n);
  1071.     dsteps[1]  = new Step(4, false, false, Foot.SO,  1.84f, 3.8f,  TS_n,  HT_n);     // Aufstellung
  1072.     dsteps[2]  = new Step(1, false, false, Foot.SOO, 0.8f,  3.15f, TS_q,  HT_th);     // r rueck
  1073.     dsteps[3]  = new Step(0, false, true,  Foot.NNO, 0.85f, 3.3f,  TS_q,  HT_wf);     // r drehen
  1074.     dsteps[4]  = new Step(1, true,  false, Foot.N,   0.3f,  3.0f,  TS_q,  HT_ht);     // l rueck
  1075.     dsteps[5]  = new Step(0, true,  true,  Foot.N,   0.1f,  2.5f,  TS_s,  HT_ht);     // l ran
  1076.     dsteps[6]  = new Step(2, false, false, Foot.NNW, 0.25f, 2.35f, TS_s,  HT_ht);     // r vorw
  1077.     dsteps[7]  = new Step(0, false, true,  Foot.N,   0.25f, 2.36f, TS_q,  HT_ht);     // r drehen
  1078.     dsteps[8]  = new Step(1, true,  false, Foot.N,   1.0f,  1.7f,  TS_q,  HT_ht);     // l vorw
  1079.     dsteps[9]  = new Step(0, true,  true,  Foot.SW,  1.08f, 1.5f,  TS_q,  HT_it);     // l vorw
  1080.     dsteps[10] = new Step(1, false, false, Foot.SW,  1.12f, 1.25f, TS_q,  HT_it);     // r vorw/seit
  1081.     dsteps[11] = new Step(1, false, false, Foot.SSW, 1.7f,  0.65f, TS_q,  HT_n);     // r rueck
  1082.     dsteps[12] = new Step(.5f,true,  false, Foot.S,   2.53f, 0.6f,  TS_q,  HT_n);     // l rueck
  1083.     dsteps[13] = new Step(.5f,false, false, Foot.S,   2.35f, 0.6f,  TS_a,  HT_n);     // r tap
  1084.     dsteps[14] = new Step(1, false, false, Foot.S,   1.97f, 0.6f,  TS_aq, HT_n);   // r tap
  1085.   }
  1086. }
  1087.  
  1088.  
  1089.  
  1090. /*
  1091.  ********************************************************
  1092.  *     SLOW FOX                    *
  1093.  ********************************************************
  1094.  */
  1095.  
  1096. /**
  1097.  * Slowfoxtrott: Stores the information of the slowfoxtrott figures.<P>
  1098.  *
  1099.  * To initialize a spezial figur:
  1100.  * <pre>
  1101.  *   Figur figur = new SlowFox(app, figNum, tempo, audioURL);
  1102.  * </pre>
  1103.  * Whereat app the applet pointer is, figNum the number of the
  1104.  * slowfoxtrott figur you want, tempo the speed of the sound defined
  1105.  * by the audioURL.<p>
  1106.  *
  1107.  * To add a new figur:
  1108.  * <ol>
  1109.  *  <li>Add the name of the figur into FigNames_{eng,ger}.
  1110.  *  <li>Add an initialization function (use initFeatherStep as template)
  1111.  *  <li>Add your initialization function into the switch statement of
  1112.  *     the constructor.
  1113.  * </ol>
  1114.  * If you don't have more than 4 figures, you don't have to change anything
  1115.  * in class Dance. If you have more figures, you only have to add more space
  1116.  * for the figur-buttons.
  1117.  *
  1118.  * @version 1.0f 25 Aug 1995
  1119.  * @author Georg Heßmann
  1120.  */
  1121. class SlowFox extends Figur {
  1122.  
  1123.   /** English name of this dance. */
  1124.   public final static String Name_eng       = "Slowfoxtrot";
  1125.   /** German name of this dance. */
  1126.   public final static String Name_ger       = "Slow Fox";
  1127.   /** Array of the english names of all implemented figures. */
  1128.   public final static String FigNames_eng[] = { "Feather Step", "Left Turn" };
  1129.   /** Array of the german names of all implemented figures. */
  1130.   public final static String FigNames_ger[] = { "Federschritt", "Linksdrehung" };
  1131.   
  1132.   /**
  1133.    * Initialze a dance and select a special figur out of this dance.
  1134.    * @param app pointer to the dance applet.
  1135.    * @param danceNum number of the choosen figur. The number is defined
  1136.    *        relative to the names in the FigNames_* array.
  1137.    * @param tempo of the given audio file
  1138.    * @param audioURL URL description of the given audio file.
  1139.    *        Might be null if "no music" is selected.
  1140.    */
  1141.   public SlowFox(Dance app, int danceNum, int temp, URL audioURL)
  1142.   {
  1143.     super(app);
  1144.  
  1145.     Takte  = 4;
  1146.  
  1147.     CurrentFig = danceNum;
  1148.     
  1149.     SlowMotionTempo = 18;
  1150.     AudioTempo      = temp;
  1151.     
  1152.     NameDance  = (app.engl) ? Name_eng : Name_ger;
  1153.     NameFigur  = (app.engl) ? FigNames_eng[CurrentFig] : FigNames_ger[CurrentFig];
  1154.     
  1155.     sound = new Sound(audioURL, app);
  1156.     
  1157.     int LeftEdge = 2*NumXPos + sound.numMaxW + 20;
  1158.     int TopEdge  = NumYPos;
  1159.  
  1160.     /* initialize dance (floor size, steps) */
  1161.     switch (danceNum) {
  1162.      case 0:
  1163.       initFeatherStep(LeftEdge, TopEdge);
  1164.       break;
  1165.      case 1:
  1166.       initLeftTurn(LeftEdge, TopEdge);
  1167.       break;
  1168.     }
  1169.   }
  1170.  
  1171.  
  1172.  
  1173.  
  1174.   /**
  1175.    * Returns a String object representing.
  1176.    */
  1177.   public String toString()
  1178.   { 
  1179.     return getClass().getName() + "[Figur=" + super.toString() + "]";
  1180.   }
  1181.  
  1182.  
  1183.   private void initFeatherStep(int LeftEdge, int TopEdge)
  1184.   {
  1185.     hfloor = new Floor(HerrStr, false, LeftEdge, TopEdge,
  1186.                1, 5, 30, 30, 30, 30, app.foots, app);
  1187.     dfloor = new Floor(DameStr, true,  hfloor.RightEdge()+20, TopEdge,
  1188.                1, 5, 30, 30, 30, 30, app.foots, app);
  1189.  
  1190.     // Tanzrichtung-Pfeile setzen
  1191.     hfloor.SetTRPos(0.6f, 4.2f);
  1192.     dfloor.SetTRPos(0.6f, 4.2f);
  1193.  
  1194.     hfloor.SetComStrPos(0.1f, -0.1f);
  1195.     dfloor.SetComStrPos(0.1f, -0.1f);
  1196.  
  1197.  
  1198.     // Herren-Schritte der Figur
  1199.     num_hsteps = 8;
  1200.     hsteps = new Step[num_hsteps];
  1201.  
  1202.     hsteps[0]  = new Step(0, true,  false, Foot.N,  -0.10f,  5.25f, TS_n, HT_n);
  1203.     hsteps[1]  = new Step(4, false, false, Foot.N,   0.11f,  5.25f, TS_n, HT_n);  // Aufstellung
  1204.     hsteps[2]  = new Step(1, false, true,  Foot.N,      0,  3.86f, TS_s, HT_ht); // r vorw
  1205.     hsteps[3]  = new Step(1, false, false, Foot.N,      0,  3.86f, TS_s, HT_ht); // r vorw
  1206.     hsteps[4]  = new Step(1, true,  false, Foot.NNO, -0.1f,  2.85f, TS_q, HT_t);  // l vorw
  1207.     hsteps[5]  = new Step(1, false, false, Foot.NNO, 0.26f,  1.8f,  TS_q, HT_th); // r vorw
  1208.     hsteps[6]  = new Step(1, true,  true,  Foot.N,    0.8f,  0.6f,  TS_s, HT_h);  // l vorw
  1209.     hsteps[7]  = new Step(1, true,  false, Foot.N,    0.8f,  0.6f,  TS_s, HT_h);  // l vorw
  1210.  
  1211.     /*
  1212.     hsteps[0]  = new Step(0, true,  false, Foot.N,  -0.10f,  5.25f, TS_n);
  1213.     hsteps[1]  = new Step(4, false, false, Foot.N,   0.11f,  5.25f, TS_n); // Aufstellung
  1214.     hsteps[2]  = new Step(2, false, false, Foot.N,      0,  3.86f, TS_s); // r vorw
  1215.     hsteps[3]  = new Step(1, true,  false, Foot.NNO, -0.1f,  2.85f, TS_q); // l vorw
  1216.     hsteps[4]  = new Step(1, false, false, Foot.NNO, 0.26f,  1.8f,  TS_q); // r vorw
  1217.     hsteps[5]  = new Step(2, true,  false, Foot.N,    0.8f,  0.6f), TS_s;  // l vorw
  1218.     */
  1219.  
  1220.     // Damen-Schritte der Figur
  1221.     num_dsteps = 8;
  1222.     dsteps = new Step[num_dsteps];
  1223.  
  1224.     dsteps[0]  = new Step(0, true,  false, Foot.S,   0.08f, 4.78f, TS_n, HT_n);
  1225.     dsteps[1]  = new Step(4, false, false, Foot.S,  -0.08f, 4.78f, TS_n, HT_n);    // Aufstellung
  1226.     dsteps[2]  = new Step(1, true,  true,  Foot.S,   0.08f, 3.38f, TS_s, HT_th);    // l rueck
  1227.     dsteps[3]  = new Step(1, true,  false, Foot.S,   0.08f, 3.38f, TS_s, HT_th);    // l rueck
  1228.     dsteps[4]  = new Step(1, false, false, Foot.SSW, 0.25f, 2.4f,  TS_q, HT_th);    // r rueck
  1229.     dsteps[5]  = new Step(1, true,  false, Foot.SSW, 0.6f,  1.4f,  TS_q, HT_th);    // l rueck
  1230.     dsteps[6]  = new Step(1, false, true,  Foot.S,   0.9f,  0.1f,  TS_s, HT_t);    // r rueck
  1231.     dsteps[7]  = new Step(1, false, false, Foot.S,   0.9f,  0.1f,  TS_s, HT_t);    // r rueck
  1232.   }
  1233.  
  1234.  
  1235.   private void initLeftTurn(int LeftEdge, int TopEdge)
  1236.   {
  1237.     hfloor = new Floor(HerrStr, false, LeftEdge, TopEdge,
  1238.                2, 6, 30, 30, 30, 30, app.foots, app);
  1239.     dfloor = new Floor(DameStr, true,  hfloor.RightEdge()+20, TopEdge,
  1240.                2, 6, 30, 30, 30, 30, app.foots, app);
  1241.  
  1242.     addRightSpace = 55;        // rechts noch etwas mehr Platz lassen
  1243.  
  1244.     // Tanzrichtung-Pfeile setzen
  1245.     hfloor.SetTRPos(0.2f, 5.2f);
  1246.     dfloor.SetTRPos(0.2f, 5.2f);
  1247.  
  1248.     hfloor.SetComStrPos(0.2f, -0.1f);
  1249.     dfloor.SetComStrPos(0.2f, -0.1f);
  1250.  
  1251.  
  1252.     // Herren-Schritte der Figur
  1253.     num_hsteps = 15;
  1254.     hsteps = new Step[num_hsteps];
  1255.  
  1256.     hsteps[0]  = new Step(0, true,  false, Foot.NW, 2.17f, 6.25f, TS_n, HT_n);
  1257.     hsteps[1]  = new Step(4, false, false, Foot.NW, 2.3f,  6.13f, TS_n, HT_n);    // Aufstellung
  1258.     hsteps[2]  = new Step(1, true,  true,  Foot.NW, 1.2f,  5.2f,  TS_s, HT_ht);    // l vorw
  1259.     hsteps[3]  = new Step(1, true,  false, Foot.NW, 1.2f,  5.2f,  TS_s, HT_ht);    // l vorw
  1260.     hsteps[4]  = new Step(0, true,  true,  Foot.SW, 1.2f,  5.0f,  TS_q, HT_t);    // l drehen
  1261.     hsteps[5]  = new Step(1, false, false, Foot.SWW,0.66f, 4.21f, TS_q, HT_t);    // r vorw
  1262.     hsteps[6]  = new Step(0, false, true,  Foot.S,  0.55f, 4.15f, TS_q, HT_th);    // r drehen
  1263.     hsteps[7]  = new Step(1, true,  false, Foot.S,  0.7f,  3.15f, TS_q, HT_th);    // l rueck
  1264.     hsteps[8]  = new Step(1, false, true,  Foot.S,  0.55f, 2.07f, TS_s, HT_tht);    // r rueck
  1265.     hsteps[9]  = new Step(1, false, false, Foot.S,  0.55f, 2.07f, TS_s, HT_tht);    // r rueck
  1266.     hsteps[10] = new Step(0, false, true,  Foot.O,  0.47f, 2.15f, TS_s, HT_t);    // r drehen
  1267.     hsteps[11] = new Step(1, true,  false, Foot.NOO,0.66f, 1.17f, TS_q, HT_t);    // l vorw
  1268.     hsteps[12] = new Step(1, false, false, Foot.NOO,1.45f, 0.5f,  TS_q, HT_th);    // r vorw
  1269.     hsteps[13] = new Step(1, true,  true,  Foot.NOO,2.6f,  0.0f,  TS_s, HT_h);    // l vorw
  1270.     hsteps[14] = new Step(1, true,  false, Foot.NOO,2.6f,  0.0f,  TS_s, HT_h);    // l vorw
  1271.     
  1272.  
  1273.  
  1274.     // Damen-Schritte der Figur
  1275.     num_dsteps = 15;
  1276.     dsteps = new Step[num_dsteps];
  1277.  
  1278.     dsteps[0]  = new Step(0, true,  false, Foot.SO, 1.9f,  5.79f, TS_n, HT_n);
  1279.     dsteps[1]  = new Step(4, false, false, Foot.SO, 1.8f,  5.87f, TS_n, HT_n);    // Aufstellung
  1280.     dsteps[2]  = new Step(1, false, true,  Foot.SO, 0.84f, 4.83f, TS_s, HT_th);    // r rueck
  1281.     dsteps[3]  = new Step(1, false, false, Foot.SO, 0.84f, 4.83f, TS_s, HT_th);    // r rueck
  1282.     dsteps[4]  = new Step(0, false, true,  Foot.N,  0.66f, 4.61f, TS_q, HT_ht);    // r drehen
  1283.     dsteps[5]  = new Step(1, true,  false, Foot.N,  0.5f,  4.61f, TS_q, HT_ht);    // l ran
  1284.     dsteps[6]  = new Step(1, false, false, Foot.N,  0.66f, 3.7f,  TS_q, HT_th);    // r vorw
  1285.     dsteps[7]  = new Step(1, true,  true,  Foot.N,  0.64f, 2.5f,  TS_s, HT_ht);    // l vorw
  1286.     dsteps[8]  = new Step(1, true,  false, Foot.N,  0.64f, 2.5f,  TS_s, HT_ht);    // l vorw
  1287.     dsteps[9]  = new Step(0, true,  true,  Foot.W,  0.73f, 2.4f,  TS_q, HT_th);    // l drehen
  1288.     dsteps[10] = new Step(1, false, false, Foot.NWW,1.1f,  1.3f,  TS_q, HT_th);    // r vorw
  1289.     dsteps[11] = new Step(0, false, true,  Foot.SWW,1.1f,  1.25f, TS_q, HT_th);    // r drehen
  1290.     dsteps[12] = new Step(1, true,  false, Foot.SWW,2.0f,  0.5f,  TS_q, HT_th);    // l rueck
  1291.     dsteps[13] = new Step(1, false, true,  Foot.SWW,3.0f, -0.15f, TS_s, HT_t);    // r rueck
  1292.     dsteps[14] = new Step(1, false, false, Foot.SWW,3.0f, -0.15f, TS_s, HT_t);    // r rueck
  1293.   }
  1294. }
  1295.  
  1296.  
  1297.  
  1298.  
  1299. /*
  1300.  ********************************************************
  1301.  *     QUICKSTEP                    *
  1302.  ********************************************************
  1303.  */
  1304.  
  1305. /**
  1306.  * Quickstep: Stores the information of the quickstep figures.<P>
  1307.  *
  1308.  * To initialize a spezial figur:
  1309.  * <pre>
  1310.  *   Figur figur = new Quickstep(app, figNum, tempo, audioURL);
  1311.  * </pre>
  1312.  * Whereat app the applet pointer is, figNum the number of the
  1313.  * slow quickstep you want, tempo the speed of the sound defined
  1314.  * by the audioURL.<p>
  1315.  *
  1316.  * To add a new figur:
  1317.  * <ol>
  1318.  *  <li>Add the name of the figur into FigNames_{eng,ger}.
  1319.  *  <li>Add an initialization function (use initNaturalTurn as template)
  1320.  *  <li>Add your initialization function into the switch statement of
  1321.  *     the constructor.
  1322.  * </ol>
  1323.  * If you don't have more than 4 figures, you don't have to change anything
  1324.  * in class Dance. If you have more figures, you only have to add more space
  1325.  * for the figur-buttons.
  1326.  *
  1327.  * @version 1.0f 25 Aug 1995
  1328.  * @author Georg Heßmann
  1329.  */
  1330. class Quickstep extends Figur {
  1331.  
  1332.   /** English name of this dance. */
  1333.   public final static String Name_eng       = "Foxtrott";
  1334.   /** German name of this dance. */
  1335.   public final static String Name_ger       = "Quickstep";
  1336.   /** Array of the english names of all implemented figures. */
  1337.   public final static String FigNames_eng[] = { "Natural Turn",
  1338.                       "ChassΘ Reverse Turn" };
  1339.   /** Array of the german names of all implemented figures. */
  1340.   public final static String FigNames_ger[] = { "Rechtsdrehung",
  1341.                       "Wechselschritt-Linksdrehung" };
  1342.   
  1343.   /**
  1344.    * Initialze a dance and select a special figur out of this dance.
  1345.    * @param app pointer to the dance applet.
  1346.    * @param danceNum number of the choosen figur. The number is defined
  1347.    *        relative to the names in the FigNames_* array.
  1348.    * @param tempo of the given audio file
  1349.    * @param audioURL URL description of the given audio file.
  1350.    *        Might be null if "no music" is selected.
  1351.    */
  1352.   public Quickstep(Dance app, int danceNum, int temp, URL audioURL)
  1353.   {
  1354.     super(app);
  1355.     
  1356.     Takte  = 4;
  1357.  
  1358.     CurrentFig = danceNum;
  1359.     
  1360.     SlowMotionTempo = 22;
  1361.     AudioTempo      = temp;
  1362.     
  1363.     NameDance  = (app.engl) ? Name_eng : Name_ger;
  1364.     NameFigur  = (app.engl) ? FigNames_eng[CurrentFig] : FigNames_ger[CurrentFig];
  1365.     
  1366.     sound = new Sound(audioURL, app);
  1367.     
  1368.     int LeftEdge = 2*NumXPos + sound.numMaxW + 20;
  1369.     int TopEdge  = NumYPos;
  1370.  
  1371.     /* initialize dance (floor size, steps) */
  1372.     switch (danceNum) {
  1373.      case 0:
  1374.       initNaturalTurn(LeftEdge, TopEdge);
  1375.       break;
  1376.      case 1:
  1377.       initChasseRTurn(LeftEdge, TopEdge);
  1378.       break;
  1379.     }
  1380.   }
  1381.  
  1382.   
  1383.  
  1384.  
  1385.   /**
  1386.    * Returns a String object representing.
  1387.    */
  1388.   public String toString()
  1389.   { 
  1390.     return getClass().getName() + "[Figur=" + super.toString() + "]";
  1391.   }
  1392.  
  1393.  
  1394.   private void initNaturalTurn(int LeftEdge, int TopEdge)
  1395.   {
  1396.     hfloor = new Floor(HerrStr, false, LeftEdge, TopEdge,
  1397.                2, 4, 30, 30, 30, 30, app.foots, app);
  1398.     dfloor = new Floor(DameStr, true,  hfloor.RightEdge()+20, TopEdge,
  1399.                2, 4, 30, 30, 30, 30, app.foots, app);
  1400.  
  1401.     // Tanzrichtung-Pfeile setzen
  1402.     hfloor.SetTRPos(1.3f, 3.2f);
  1403.     dfloor.SetTRPos(1.5f, 3.2f);
  1404.  
  1405.     hfloor.SetComStrPos(-0.1f, -0.1f);
  1406.     dfloor.SetComStrPos(-0.1f, -0.1f);
  1407.  
  1408.  
  1409.     // Herren-Schritte der Figur
  1410.     num_hsteps = 11;
  1411.     hsteps = new Step[num_hsteps];
  1412.  
  1413.     hsteps[0]  = new Step(0, true,  false, Foot.NO, -0.25f, 4.15f, TS_n, HT_n);
  1414.     hsteps[1]  = new Step(4, false, false, Foot.NO, -0.1f,  4.25f, TS_n, HT_n);    // Aufstellung
  1415.     hsteps[2]  = new Step(2, false, false, Foot.NO,  0.82f, 3.18f, TS_s, HT_ht);    // r vorw
  1416.     hsteps[3]  = new Step(0, false, true,  Foot.SO,  0.83f, 2.98f, TS_q, HT_t);    // r drehen
  1417.     hsteps[4]  = new Step(1, true,  false, Foot.SO,  1.55f, 2.1f,  TS_q, HT_t);    // l vorw
  1418.     hsteps[5]  = new Step(0, true,  true,  Foot.S,   1.65f, 2.07f, TS_q, HT_th); // l drehen
  1419.     hsteps[6]  = new Step(1, false, false, Foot.S,   1.45f, 2.07f, TS_q, HT_th); // r vorw schl
  1420.     hsteps[7]  = new Step(2, true,  false, Foot.S,   1.65f, 1.17f, TS_s, HT_th);    // l rueck
  1421.     hsteps[8]  = new Step(0, true,  true,  Foot.NW,  1.63f, 0.8f,  TS_s, HT_hiw);    // l drehen
  1422.     hsteps[9]  = new Step(2, false, false, Foot.NW,  1.74f, 0.7f,  TS_s, HT_hiw);    // r rueck ran
  1423.     hsteps[10] = new Step(2, true,  false, Foot.NW,  0.85f, 0.19f, TS_s, HT_h);    // l vorw
  1424.  
  1425.     // Damen-Schritte der Figur
  1426.     num_dsteps = 11;
  1427.     dsteps = new Step[num_dsteps];
  1428.  
  1429.     dsteps[0]  = new Step(0, true,  false, Foot.SW, 0.26f, 3.89f, TS_n, HT_n);
  1430.     dsteps[1]  = new Step(4, false, false, Foot.SW, 0.14f, 3.83f, TS_n, HT_n);    // Aufstellung
  1431.     dsteps[2]  = new Step(2, true,  false, Foot.SW, 1.17f, 2.82f, TS_s, HT_th);    // l rueck
  1432.     dsteps[3]  = new Step(0, true,  true,  Foot.NW, 1.18f, 3.06f, TS_q, HT_t);    // l drehen
  1433.     dsteps[4]  = new Step(1, false, false, Foot.N,  1.6f,  2.55f, TS_q, HT_t);    // r rueck
  1434.     dsteps[5]  = new Step(1, true,  false, Foot.N,  1.45f, 2.55f, TS_q, HT_th);    // l ran
  1435.     dsteps[6]  = new Step(2, false, false, Foot.N,  1.5f,  1.55f, TS_s, HT_ht);    // r vorw
  1436.     dsteps[7]  = new Step(0, false, true,  Foot.O,  1.4f,  1.45f, TS_s, HT_th);    // r drehen
  1437.     dsteps[8]  = new Step(2, true,  false, Foot.O,  1.4f,  0.47f, TS_s, HT_th);    // l vorw
  1438.     dsteps[9]  = new Step(0, true,  true,  Foot.SO, 1.42f, 0.42f, TS_s, HT_t);    // l drehen
  1439.     dsteps[10] = new Step(2, false, false, Foot.SO, 0.65f,-0.25f, TS_s, HT_t);    // r rueck
  1440.   }
  1441.   
  1442.   private void initChasseRTurn(int LeftEdge, int TopEdge)
  1443.   {
  1444.     hfloor = new Floor(HerrStr, false, LeftEdge, TopEdge,
  1445.                2, 4, 30, 30, 30, 30, app.foots, app);
  1446.     dfloor = new Floor(DameStr, true,  hfloor.RightEdge()+20, TopEdge,
  1447.                2, 4, 30, 30, 30, 30, app.foots, app);
  1448.  
  1449.     // Tanzrichtung-Pfeile setzen
  1450.     hfloor.SetTRPos(1.5f, 1.2f);
  1451.     dfloor.SetTRPos(1.5f, 1.2f);
  1452.  
  1453.     hfloor.SetComStrPos(0.2f, -0.1f);
  1454.     dfloor.SetComStrPos(0.2f, -0.1f);
  1455.  
  1456.  
  1457.     // Herren-Schritte der Figur
  1458.     num_hsteps = 12;
  1459.     hsteps = new Step[num_hsteps];
  1460.  
  1461.     hsteps[0]  = new Step(0, true,  false, Foot.NW, 2.17f, 4.25f, TS_n, HT_n);
  1462.     hsteps[1]  = new Step(4, false, false, Foot.NW, 2.3f,  4.13f, TS_n, HT_n);    // Aufstellung
  1463.     hsteps[2]  = new Step(2, true,  false, Foot.NW, 1.2f,  3.2f,  TS_s, HT_ht);    // l vorw
  1464.     hsteps[3]  = new Step(0, true,  true,  Foot.SW, 1.2f,  3.0f,  TS_q, HT_t);    // l drehen
  1465.     hsteps[4]  = new Step(1, false, false, Foot.SW, 0.45f, 2.37f, TS_q, HT_t);    // r vorw
  1466.     hsteps[5]  = new Step(0, false, true,  Foot.S,  0.3f,  2.35f, TS_q, HT_th);    // r drehen
  1467.     hsteps[6]  = new Step(1, true,  false, Foot.S,  0.5f,  2.35f, TS_q, HT_th);    // l ran
  1468.     hsteps[7]  = new Step(2, false, false, Foot.S,  0.3f,  1.40f, TS_s, HT_th);    // r rueck
  1469.     hsteps[8]  = new Step(0, false, true,  Foot.SSO,0.22f, 1.35f, TS_q, HT_h);    // r drehen
  1470.     hsteps[9]  = new Step(1, true,  false, Foot.NO, 0.22f, 1.05f, TS_q, HT_h);    // l rueck
  1471.     hsteps[10] = new Step(1, false, false, Foot.NO, 0.33f, 1.16f, TS_q, HT_h);    // r rueck ran
  1472.     hsteps[11] = new Step(2, true,  false, Foot.NO, 1.0f,  0.35f, TS_s, HT_h);    // l vorw
  1473.  
  1474.     // Damen-Schritte der Figur
  1475.     num_dsteps = 12;
  1476.     dsteps = new Step[num_dsteps];
  1477.  
  1478.     dsteps[0]  = new Step(0, true,  false, Foot.SO, 1.9f,  3.79f, TS_n, HT_n);
  1479.     dsteps[1]  = new Step(4, false, false, Foot.SO, 1.8f,  3.87f, TS_n, HT_n);    // Aufstellung
  1480.     dsteps[2]  = new Step(2, false, false, Foot.SO, 0.84f, 2.83f, TS_s, HT_th);    // r rueck
  1481.     dsteps[3]  = new Step(0, false, true,  Foot.NO, 0.84f, 3.0f,  TS_q, HT_t);    // r drehen
  1482.     dsteps[4]  = new Step(1, true,  false, Foot.N,  0.3f,  2.7f,  TS_q, HT_t);    // l seit
  1483.     dsteps[5]  = new Step(1, false, false, Foot.N,  0.45f, 2.7f,  TS_q, HT_th);    // r ran
  1484.     dsteps[6]  = new Step(2, true,  false, Foot.N,  0.36f, 1.77f, TS_s, HT_ht);    // l vorw
  1485.     dsteps[7]  = new Step(0, true,  true,  Foot.W,  0.47f, 1.63f, TS_q, HT_t);    // l drehen
  1486.     dsteps[8]  = new Step(1, false, false, Foot.W,  0.45f, 0.78f, TS_q, HT_t);    // r vorw/seit
  1487.     dsteps[9]  = new Step(0, false, true,  Foot.SW, 0.45f, 0.75f, TS_q, HT_th);    // r drehen
  1488.     dsteps[10] = new Step(1, true,  false, Foot.SW, 0.55f, 0.82f, TS_q, HT_th);    // l ran
  1489.     dsteps[11] = new Step(2, false, false, Foot.SW, 1.36f, 0.1f,  TS_s, HT_t);    // r rueck
  1490.   }
  1491. }
  1492.  
  1493.  
  1494.  
  1495.  
  1496.